import request from '@/axios/request';
import url from '@/axios/url';
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesFqcTaskDetail/export`
// 获取子表详情
export function getInfo (id = '') {
  return request({
    url: `${mesUrl}mesFqcTaskDetail/info/${id}`,
    method: 'get'
  })
}
// 获取主表详情
export function getMasterInfo (id = '') {
  return request({
    url: `${mesUrl}mesFqcTask/info1/${id}`,
    method: 'get'
  })
}
//分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}mesFqcTaskDetail`,
    method: 'get',
    params,
  });
}
//新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}mesFqcTaskDetail`,
    method: 'post',
    data,
  });
}
//修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesFqcTaskDetail`,
    method: 'put',
    data,
  });
}
//删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}mesFqcTaskDetail/${id}`,
    method: 'put',
  });
}

// 检验结果：0-待检测、1-合格、2-不合格
export function getResult() {
  return request({
    url: `${adminUrl}dict/type/mes_fqc_task_detail_result`,
    method: "get",
  });
}
